﻿<UserControl x:Class="CPPEI.Coolzon.Theme.Default.MainViewControl.Header"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:convert="clr-namespace:CPPEI.Coolzon.Theme.Default.MainViewControl"
             mc:Ignorable="d" 
             d:DesignHeight="66" d:DesignWidth="1366">
    <UserControl.Resources>
        <convert:BackgroundConverter x:Key="backgroundConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="/CPPEI.Coolzon.Theme.Default;component/Images/banner.jpg"></ImageBrush>
        </Grid.Background>
        <Grid.Resources>
            <Style TargetType="TextBlock">
                <Setter Property="Foreground" Value="White" />
            </Style>
            <Style TargetType="Button">
                <Setter Property="Width" Value="57"/>
                <Setter Property="Height" Value="59"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="525"></ColumnDefinition>
            <ColumnDefinition Width="388*"></ColumnDefinition>
            <ColumnDefinition Width="160*"></ColumnDefinition>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
        <Image Source="/CPPEI.Coolzon.Theme.Default;component/Images/logo.png" Margin="20,0,0,0"/>
        <Grid Grid.Column="1" Grid.ColumnSpan="2" Margin="117,0,0,0">
            <TextBlock Grid.Column="1" x:Name="tbMessage" Text="2014年4月8日 星期二  欢迎,890678" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="White" Height="16" Width="auto"/>
        </Grid>

        <Grid Grid.Column="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"></ColumnDefinition>
                <ColumnDefinition Width="auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal">
                <Label x:Name="lblLogout" Grid.Column="0" Content="注 销" Foreground="White"
                       HorizontalAlignment="Center" VerticalAlignment="Center" Width="auto" MouseLeftButtonDown="lblLogout_MouseLeftButtonDown"
                       Margin="10"/>
                <Label x:Name="_ctlTextExit" Grid.Column="0" Content="退 出" Foreground="White"
                       HorizontalAlignment="Center" VerticalAlignment="Center" Width="auto" MouseLeftButtonDown="_ctlTextExit_MouseLeftButtonDown"
                       Margin="10"/>
                <Label x:Name="_ctlTextSetting" Grid.Column="0" Content="设 置" Foreground="White"
                       HorizontalAlignment="Center" VerticalAlignment="Center" Width="auto" MouseLeftButtonDown="_ctlTextSetting_MouseLeftButtonDown_1"
                       Margin="10"/>
            </StackPanel>
            <Image x:Name="imgPilotLight"  Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/CPPEI.Coolzon.Theme.Default;component/Images/bglv.png" Width="auto" Height="18" >
                <Image.ToolTip>
                    <ToolTip>
                        <DataGrid x:Name="dataGridProxyState" AutoGenerateColumns="False" IsReadOnly="True">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="服务地址" Width="100" Binding="{Binding IP}"/>
                                <DataGridTextColumn Header="端口" Width="40" Binding="{Binding Port}"/>
                                <DataGridCheckBoxColumn Header="是否连接" Width="80" Binding="{Binding IsConnected}"/>
                                <DataGridTextColumn Header="延迟时间(毫秒)" Width="100" Binding="{ Binding Lag}"/>
                            </DataGrid.Columns>
                            <DataGrid.CellStyle>
                                <Style TargetType="DataGridCell" >
                                    <Setter Property="Background" Value="{Binding Path=IsConnected, Converter={StaticResource backgroundConverter}}"/>
                                </Style>
                            </DataGrid.CellStyle>
                        </DataGrid>
                    </ToolTip>
                </Image.ToolTip>
            </Image>
            <TextBlock Name="_ctlTextLag" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Text="0" Width="auto" Height="18" ></TextBlock>
        </Grid>
       
    </Grid>
</UserControl>
